﻿
/*******************************************************************************************
// ©2009 Microsoft Corporation.  This code is provided under the Microsoft Public License.
*******************************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace ClientBilling
{
    public class Global : System.Web.HttpApplication
    {

        //TODO: remove Clarity settings from Web.config and Clients.xml

        protected void Application_Start(object sender, EventArgs e)
        {
            // Start up the UCMA CollaborationPlatform through the BilledCallManager.
            BilledCallManager.Instance.Startup();

            // Store the URL of the application for the extended window message.
            HttpRequest request = HttpContext.Current.Request;
            ExtendedWindowMessage.FullApplicationPath = string.Format("http://{0}:{1}{2}", request.Url.Host, request.Url.Port, request.ApplicationPath);   
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {
            // Clean up the UCMA classes when we are done. It is important to do this.
            BilledCallManager.Instance.Cleanup();
        }
    }
}